<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta http-equiv="Content-Style-Type" content="text/css">
  <title></title>
  <meta name="Generator" content="Cocoa HTML Writer">
  <meta name="CocoaVersion" content="1038.36">
  <style type="text/css">
    p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px STSong}
    p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Times; min-height: 14.0px}
    p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Times}
    span.s1 {font: 12.0px Times}
    span.s2 {font: 12.0px STSong}
  </style>
</head>
<body>
<p class="p1">欢迎大家使用<span class="s1">Sedna</span>分布式文件系统，本手册将比较简略的讲述如何安装，测试该文件系统，以及文件系统的核心部分。</p>
<p class="p2"><br></p>
<p class="p1">谢您对本软件有兴趣，如果您在使用过程中遇到任何问题（我想，这简直是一定的，<span class="s1">:P </span>）<span class="s1">,</span>请您和我联系，</p>
<p class="p1">我会更加有针对性的告诉您应该怎么配置。</p>
<p class="p2"><br></p>
<p class="p2"><br></p>
<p class="p3"><span class="s2">邮箱：</span>daidongly@gmail.com</p>
<p class="p3">QQ<span class="s2">：</span>25720846<span class="s2">，验证：</span>Sedna</p>
<p class="p2"><br></p>
<p class="p3">--------------------------------------------------------------------------------</p>
<p class="p2"><br></p>
<p class="p1"><span class="s1">1 </span>运行环境</p>
<p class="p2"><br></p>
<p class="p2"><br></p>
<p class="p3">1.1) Sedna<span class="s2">本身是基于</span>ZooKeeper<span class="s2">的，并且利用</span>ZooKeeper<span class="s2">来进行集群状态信息管理和维护，因此</span>Sedna<span class="s2">运行</span></p>
<p class="p3"><span class="s2">需要</span>ZooKeeper<span class="s2">的支持，</span>ZooKeeper<span class="s2">版本为</span>3.3.1<span class="s2">。</span></p>
<p class="p2"><br></p>
<p class="p3">1.2) Senda<span class="s2">运行在</span>Linux<span class="s2">，</span>Mac OS X<span class="s2">之上，不支持</span>Windows<span class="s2">。建议使用</span>Linux 2.6<span class="s2">以上内核版本</span></p>
<p class="p2"><br></p>
<p class="p1"><span class="s1">1.3) Sedna</span>可以运行在集群模式和单机模式下，第<span class="s1">2</span>节将详述如何运行在集群和单机模式下</p>
<p class="p2"><br></p>
<p class="p3">--------------------------------------------------------------------------------</p>
<p class="p2"><br></p>
<p class="p1"><span class="s1">2 </span>配置和运行</p>
<p class="p2"><br></p>
<p class="p3">2.1) <span class="s2">单机模式</span></p>
<p class="p2"><br></p>
<p class="p1"><span class="s1">* </span>首先修改<span class="s1">conf</span>目录下的<span class="s1">nodes</span>文件，单机模式下，该文件内容应为空</p>
<p class="p3">* <span class="s2">安装</span>MemCached<span class="s2">（</span>@TODO: <span class="s2">代码目录下加上修改好的</span>MemCached<span class="s2">，并且修改启动脚本）</span></p>
<p class="p3">* <span class="s2">安装</span>ZooKeeper<span class="s2">单机模式，参见</span>: http://zookeeper.apache.org<span class="s2">，记下启动端口</span></p>
<p class="p3">* <span class="s2">修改</span>conf<span class="s2">目录下</span>conf.properties<span class="s2">文件，修改</span>zookeeper_servers=127.0.0.1:<span class="s2">端口号，保存</span></p>
<p class="p3">* <span class="s2">在</span>Sedna<span class="s2">根目录下（请注意，一定要在</span>Sedna<span class="s2">根目录下），执行</span> bin/start-sedna.sh<span class="s2">即可</span></p>
<p class="p2"><br></p>
<p class="p3">2.2) <span class="s2">分布式模式</span></p>
<p class="p2"><br></p>
<p class="p1"><span class="s1">* </span>首先配置集群，选取一台机器为启动者（<span class="s1">starter</span>），该服务器必须能够无密码<span class="s1">ssh</span>到所有其他服务器。</p>
<p class="p3">SSH<span class="s2">具体的配置方法参见：</span>http://hadoop.apache.org/common/docs/r0.18.3/quickstart.html#Setup+passphraseless</p>
<p class="p2"><br></p>
<p class="p3">* <span class="s2">安装</span>ZooKeeper 3.3.1<span class="s2">集群模式，参见</span>: http://zookeeper.apache.org</p>
<p class="p2"><br></p>
<p class="p3">* <span class="s2">启动</span>ZooKeeper 3.3.1<span class="s2">，并且配置</span>ZooKeeper<span class="s2">集群中包括的机器以及端口号</span></p>
<p class="p2"><br></p>
<p class="p3">* <span class="s2">修改</span>conf<span class="s2">目录下</span>conf.properties<span class="s2">文件，修改</span>zookeeper_servers=ip1:port1,ip2:port2...<span class="s2">服务器</span></p>
<p class="p1">由两部分组成：<span class="s1">ip</span>地址和端口号，以逗号相隔。</p>
<p class="p2"><br></p>
<p class="p1"><span class="s1">* </span>修改<span class="s1">conf</span>目录下<span class="s1">nodes</span>文件，每一行是一个节点<span class="s1">ip</span></p>
<p class="p2"><br></p>
<p class="p1"><span class="s1">* </span>在<span class="s1">starter</span>服务器上安装并且配置成功之后，将<span class="s1">Sedna</span>文件夹拷贝到每一台机器的相同目录下（一定需要是相同目录）</p>
<p class="p2"><br></p>
<p class="p3">* <span class="s2">在</span>Sedna<span class="s2">根目录下（请注意，一定要在</span>Sedna<span class="s2">跟目录下），执行</span> bin/start-sedna.sh<span class="s2">即可</span></p>
<p class="p2"><br></p>
<p class="p3">--------------------------------------------------------------------------------</p>
<p class="p2"><br></p>
<p class="p3">3 <span class="s2">使用</span>Sedna</p>
<p class="p2"><br></p>
<p class="p3">3.1) JAVA API</p>
<p class="p2"><br></p>
<p class="p3"><span class="s2">当前版本</span>Sedna<span class="s2">只提供了</span>JAVA API<span class="s2">供大家使用，使用方法请参考代码中</span>org.mcl.Sedna.Client.ClientMain<span class="s2">类）</span></p>
<p class="p2"><br></p>
<p class="p1">实现使用<span class="s1">conf</span>文件和当前的<span class="s1">Sedna</span>集群取得联系，并且实例化一个<span class="s1">FileSystem</span>对象，使用该对象的方法就可以读写数据。</p>
<p class="p2"><br></p>
<p class="p3">--------------------------------------------------------------------------------</p>
<p class="p2"><br></p>
<p class="p3">4 Sedna<span class="s2">使用的组件</span></p>
<p class="p2"><br></p>
<p class="p1"><span class="s1">Sedna</span>使用了下面这些开源组件</p>
<p class="p2"><br></p>
<p class="p3">* ZooKeeper 3.3.1</p>
<p class="p3">* MemCached 1.4.5</p>
<p class="p3">* xSocket 2.1.6</p>
<p class="p3">* log4j 1.2.15</p>
<p class="p3">* Jetty 6.1.14</p>
<p class="p3">* Java-MemCached-2.5.2</p>
</body>
</html>
